﻿
namespace AstekServis.Web.Data
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.ComponentModel.DataAnnotations;
    using System.Data;
    using System.Linq;
    using System.ServiceModel.DomainServices.EntityFramework;
    using System.ServiceModel.DomainServices.Hosting;
    using System.ServiceModel.DomainServices.Server;
    using System.Xml.Linq;


    // Implements application logic using the AsTekEntities context.
    // TODO: Add your application logic to these methods or in additional methods.
    // TODO: Wire up authentication (Windows/ASP.NET Forms) and uncomment the following to disable anonymous access
    // Also consider adding roles to restrict access as appropriate.
    // [RequiresAuthentication]
    [EnableClientAccess()]
    public class AsTekDomainService : LinqToEntitiesDomainService<AsTekEntities>
    {
        public string[] GetSqlQuery(string sql1, string sql2)
        {
            Mikro mk = new Mikro();
            string[] dizi = new string[2];

            if (!string.IsNullOrEmpty(sql1))
                dizi[0] = mk.GetData(sql1);

            if (!string.IsNullOrEmpty(sql2))
                dizi[1] = mk.GetData(sql2);

            return dizi;
        }

        public ServisDetaylari[] GetServisBilgileri(int servisID, int dbNo)
        {
            return this.ObjectContext.AsTek_ServisDetaylari(servisID, dbNo).ToArray();
        }

        public ModemDurumu[] ModemDurumlari()
        {
            XDocument doc = XDocument.Load("http://reklam.smartmedya.com/webservice/m_durum.php");
            var modemler = (from p in doc.Elements("Results").Elements("Durum")
                            select new ModemDurumu
                            {
                                Plaka = p.Element("Plaka").Value.Replace("\n", ""),
                                KayitTarihi = p.Element("RegisterTarih").Value,
                                SonAktiflik = p.Element("SonAktifTarih").Value,
                                SistemNo = p.Element("SistemNo").Value,
                                SonAktifGun = p.Element("SonAktifGun").Value
                            }).ToArray();

            if (modemler.Length > 0)
            {
                using (AsTekEntities ent = new AsTekEntities())
                {
                    var araclistesi = ent.AracBilgileri.ToList();
                    foreach (var item in modemler)
                    {
                        var arac = araclistesi.Where(x => x.Plaka == item.Plaka).FirstOrDefault();
                        if (arac != null)
                        {
                            item.Firma = arac.FirmaAdi;
                            item.Grup = arac.GrupAdi;
                            item.AracID = arac.ID;
                            item.AracKodu = arac.AracKodu;
                            item.Adres = arac.Adres;
                        }

                        if (!string.IsNullOrEmpty(item.SonAktifGun))
                        {
                            if (int.Parse(item.SonAktifGun) >= 10)
                            {
                                item.ToolTip = "En az 10 gündür sinyal alınamıyor !";
                                item.Picture = "/AstekServis;component/cross.png";
                            }
                            else
                            {
                                item.ToolTip = "Çalışıyor";
                                item.Picture = "/AstekServis;component/ok.png";
                            }
                        }

                        if (string.IsNullOrEmpty(item.KayitTarihi) && string.IsNullOrEmpty(item.SonAktiflik))
                        {
                            item.ToolTip = "Henüz sinyal yok !";
                            item.Picture = "/AstekServis;component/cancel.png";
                        }
                        else
                        {
                            item.KayitTarihi = item.KayitTarihi.TarihDuzelt();
                            item.SonAktiflik = item.SonAktiflik.TarihDuzelt();
                        }
                    }
                }
            }
            return modemler;
        }
        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'AnaCariler' query.
        public IQueryable<AnaCari> GetAnaCariler()
        {
            return this.ObjectContext.AnaCariler;
        }

        public void InsertAnaCari(AnaCari anaCari)
        {
            if ((anaCari.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(anaCari, EntityState.Added);
            }
            else
            {
                this.ObjectContext.AnaCariler.AddObject(anaCari);
            }
        }

        public void UpdateAnaCari(AnaCari currentAnaCari)
        {
            this.ObjectContext.AnaCariler.AttachAsModified(currentAnaCari, this.ChangeSet.GetOriginal(currentAnaCari));
        }

        public void DeleteAnaCari(AnaCari anaCari)
        {
            if ((anaCari.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(anaCari, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.AnaCariler.Attach(anaCari);
                this.ObjectContext.AnaCariler.DeleteObject(anaCari);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'Araclar' query.
        public IQueryable<Arac> GetAraclar()
        {
            return this.ObjectContext.Araclar;
        }

        public void InsertArac(Arac arac)
        {
            if ((arac.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(arac, EntityState.Added);
            }
            else
            {
                this.ObjectContext.Araclar.AddObject(arac);
            }
        }

        public void UpdateArac(Arac currentArac)
        {
            this.ObjectContext.Araclar.AttachAsModified(currentArac, this.ChangeSet.GetOriginal(currentArac));
        }

        public void DeleteArac(Arac arac)
        {
            if ((arac.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(arac, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.Araclar.Attach(arac);
                this.ObjectContext.Araclar.DeleteObject(arac);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'AracBilgileri' query.
        public IQueryable<AracBilgi> GetAracBilgileri()
        {
            return this.ObjectContext.AracBilgileri;
        }

        public void InsertAracBilgi(AracBilgi aracBilgi)
        {
            if ((aracBilgi.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(aracBilgi, EntityState.Added);
            }
            else
            {
                this.ObjectContext.AracBilgileri.AddObject(aracBilgi);
            }
        }

        public void UpdateAracBilgi(AracBilgi currentAracBilgi)
        {
            this.ObjectContext.AracBilgileri.AttachAsModified(currentAracBilgi, this.ChangeSet.GetOriginal(currentAracBilgi));
        }

        public void DeleteAracBilgi(AracBilgi aracBilgi)
        {
            if ((aracBilgi.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(aracBilgi, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.AracBilgileri.Attach(aracBilgi);
                this.ObjectContext.AracBilgileri.DeleteObject(aracBilgi);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'AracHareketleri' query.
        public IQueryable<AracHareketi> GetAracHareketleri()
        {
            return this.ObjectContext.AracHareketleri;
        }

        public void InsertAracHareketi(AracHareketi aracHareketi)
        {
            if ((aracHareketi.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(aracHareketi, EntityState.Added);
            }
            else
            {
                this.ObjectContext.AracHareketleri.AddObject(aracHareketi);
            }
        }

        public void UpdateAracHareketi(AracHareketi currentAracHareketi)
        {
            this.ObjectContext.AracHareketleri.AttachAsModified(currentAracHareketi, this.ChangeSet.GetOriginal(currentAracHareketi));
        }

        public void DeleteAracHareketi(AracHareketi aracHareketi)
        {
            if ((aracHareketi.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(aracHareketi, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.AracHareketleri.Attach(aracHareketi);
                this.ObjectContext.AracHareketleri.DeleteObject(aracHareketi);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'AracHubYerleri' query.
        public IQueryable<AracHubYeri> GetAracHubYerleri()
        {
            return this.ObjectContext.AracHubYerleri;
        }

        public void InsertAracHubYeri(AracHubYeri aracHubYeri)
        {
            if ((aracHubYeri.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(aracHubYeri, EntityState.Added);
            }
            else
            {
                this.ObjectContext.AracHubYerleri.AddObject(aracHubYeri);
            }
        }

        public void UpdateAracHubYeri(AracHubYeri currentAracHubYeri)
        {
            this.ObjectContext.AracHubYerleri.AttachAsModified(currentAracHubYeri, this.ChangeSet.GetOriginal(currentAracHubYeri));
        }

        public void DeleteAracHubYeri(AracHubYeri aracHubYeri)
        {
            if ((aracHubYeri.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(aracHubYeri, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.AracHubYerleri.Attach(aracHubYeri);
                this.ObjectContext.AracHubYerleri.DeleteObject(aracHubYeri);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'AracMarkalari' query.
        public IQueryable<AracMarka> GetAracMarkalari()
        {
            return this.ObjectContext.AracMarkalari;
        }

        public void InsertAracMarka(AracMarka aracMarka)
        {
            if ((aracMarka.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(aracMarka, EntityState.Added);
            }
            else
            {
                this.ObjectContext.AracMarkalari.AddObject(aracMarka);
            }
        }

        public void UpdateAracMarka(AracMarka currentAracMarka)
        {
            this.ObjectContext.AracMarkalari.AttachAsModified(currentAracMarka, this.ChangeSet.GetOriginal(currentAracMarka));
        }

        public void DeleteAracMarka(AracMarka aracMarka)
        {
            if ((aracMarka.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(aracMarka, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.AracMarkalari.Attach(aracMarka);
                this.ObjectContext.AracMarkalari.DeleteObject(aracMarka);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'AracOzellikleri' query.
        public IQueryable<AracOzellik> GetAracOzellikleri()
        {
            return this.ObjectContext.AracOzellikleri;
        }

        public void InsertAracOzellik(AracOzellik aracOzellik)
        {
            if ((aracOzellik.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(aracOzellik, EntityState.Added);
            }
            else
            {
                this.ObjectContext.AracOzellikleri.AddObject(aracOzellik);
            }
        }

        public void UpdateAracOzellik(AracOzellik currentAracOzellik)
        {
            this.ObjectContext.AracOzellikleri.AttachAsModified(currentAracOzellik, this.ChangeSet.GetOriginal(currentAracOzellik));
        }

        public void DeleteAracOzellik(AracOzellik aracOzellik)
        {
            if ((aracOzellik.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(aracOzellik, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.AracOzellikleri.Attach(aracOzellik);
                this.ObjectContext.AracOzellikleri.DeleteObject(aracOzellik);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'Depolar' query.
        public IQueryable<Depo> GetDepolar()
        {
            return this.ObjectContext.Depolar;
        }

        public void InsertDepo(Depo depo)
        {
            if ((depo.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(depo, EntityState.Added);
            }
            else
            {
                this.ObjectContext.Depolar.AddObject(depo);
            }
        }

        public void UpdateDepo(Depo currentDepo)
        {
            this.ObjectContext.Depolar.AttachAsModified(currentDepo, this.ChangeSet.GetOriginal(currentDepo));
        }

        public void DeleteDepo(Depo depo)
        {
            if ((depo.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(depo, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.Depolar.Attach(depo);
                this.ObjectContext.Depolar.DeleteObject(depo);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'Dovizler' query.
        public IQueryable<Doviz> GetDovizler()
        {
            return this.ObjectContext.Dovizler;
        }

        public void InsertDoviz(Doviz doviz)
        {
            if ((doviz.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(doviz, EntityState.Added);
            }
            else
            {
                this.ObjectContext.Dovizler.AddObject(doviz);
            }
        }

        public void UpdateDoviz(Doviz currentDoviz)
        {
            this.ObjectContext.Dovizler.AttachAsModified(currentDoviz, this.ChangeSet.GetOriginal(currentDoviz));
        }

        public void DeleteDoviz(Doviz doviz)
        {
            if ((doviz.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(doviz, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.Dovizler.Attach(doviz);
                this.ObjectContext.Dovizler.DeleteObject(doviz);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'DovizKurlari' query.
        public IQueryable<DovizKur> GetDovizKurlari()
        {
            return this.ObjectContext.DovizKurlari;
        }

        public void InsertDovizKur(DovizKur dovizKur)
        {
            if ((dovizKur.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(dovizKur, EntityState.Added);
            }
            else
            {
                this.ObjectContext.DovizKurlari.AddObject(dovizKur);
            }
        }

        public void UpdateDovizKur(DovizKur currentDovizKur)
        {
            this.ObjectContext.DovizKurlari.AttachAsModified(currentDovizKur, this.ChangeSet.GetOriginal(currentDovizKur));
        }

        public void DeleteDovizKur(DovizKur dovizKur)
        {
            if ((dovizKur.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(dovizKur, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.DovizKurlari.Attach(dovizKur);
                this.ObjectContext.DovizKurlari.DeleteObject(dovizKur);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'FaturaBaglantilari' query.
        public IQueryable<FaturaBaglanti> GetFaturaBaglantilari()
        {
            return this.ObjectContext.FaturaBaglantilari;
        }

        public void InsertFaturaBaglanti(FaturaBaglanti faturaBaglanti)
        {
            if ((faturaBaglanti.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(faturaBaglanti, EntityState.Added);
            }
            else
            {
                this.ObjectContext.FaturaBaglantilari.AddObject(faturaBaglanti);
            }
        }

        public void UpdateFaturaBaglanti(FaturaBaglanti currentFaturaBaglanti)
        {
            this.ObjectContext.FaturaBaglantilari.AttachAsModified(currentFaturaBaglanti, this.ChangeSet.GetOriginal(currentFaturaBaglanti));
        }

        public void DeleteFaturaBaglanti(FaturaBaglanti faturaBaglanti)
        {
            if ((faturaBaglanti.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(faturaBaglanti, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.FaturaBaglantilari.Attach(faturaBaglanti);
                this.ObjectContext.FaturaBaglantilari.DeleteObject(faturaBaglanti);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'FaturaDetaylari' query.
        public IQueryable<FaturaDetay> GetFaturaDetaylari()
        {
            return this.ObjectContext.FaturaDetaylari;
        }

        public void InsertFaturaDetay(FaturaDetay faturaDetay)
        {
            if ((faturaDetay.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(faturaDetay, EntityState.Added);
            }
            else
            {
                this.ObjectContext.FaturaDetaylari.AddObject(faturaDetay);
            }
        }

        public void UpdateFaturaDetay(FaturaDetay currentFaturaDetay)
        {
            this.ObjectContext.FaturaDetaylari.AttachAsModified(currentFaturaDetay, this.ChangeSet.GetOriginal(currentFaturaDetay));
        }

        public void DeleteFaturaDetay(FaturaDetay faturaDetay)
        {
            if ((faturaDetay.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(faturaDetay, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.FaturaDetaylari.Attach(faturaDetay);
                this.ObjectContext.FaturaDetaylari.DeleteObject(faturaDetay);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'Filmler' query.
        public IQueryable<Film> GetFilmler()
        {
            return this.ObjectContext.Filmler;
        }

        public void InsertFilm(Film film)
        {
            if ((film.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(film, EntityState.Added);
            }
            else
            {
                this.ObjectContext.Filmler.AddObject(film);
            }
        }

        public void UpdateFilm(Film currentFilm)
        {
            this.ObjectContext.Filmler.AttachAsModified(currentFilm, this.ChangeSet.GetOriginal(currentFilm));
        }

        public void DeleteFilm(Film film)
        {
            if ((film.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(film, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.Filmler.Attach(film);
                this.ObjectContext.Filmler.DeleteObject(film);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'FilmSozlesmeleri' query.
        public IQueryable<FilmSozlesmesi> GetFilmSozlesmeleri()
        {
            return this.ObjectContext.FilmSozlesmeleri;
        }

        public void InsertFilmSozlesmesi(FilmSozlesmesi filmSozlesmesi)
        {
            if ((filmSozlesmesi.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(filmSozlesmesi, EntityState.Added);
            }
            else
            {
                this.ObjectContext.FilmSozlesmeleri.AddObject(filmSozlesmesi);
            }
        }

        public void UpdateFilmSozlesmesi(FilmSozlesmesi currentFilmSozlesmesi)
        {
            this.ObjectContext.FilmSozlesmeleri.AttachAsModified(currentFilmSozlesmesi, this.ChangeSet.GetOriginal(currentFilmSozlesmesi));
        }

        public void DeleteFilmSozlesmesi(FilmSozlesmesi filmSozlesmesi)
        {
            if ((filmSozlesmesi.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(filmSozlesmesi, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.FilmSozlesmeleri.Attach(filmSozlesmesi);
                this.ObjectContext.FilmSozlesmeleri.DeleteObject(filmSozlesmesi);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'Firmalar' query.
        public IQueryable<Firma> GetFirmalar()
        {
            return this.ObjectContext.Firmalar;
        }

        public void InsertFirma(Firma firma)
        {
            if ((firma.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(firma, EntityState.Added);
            }
            else
            {
                this.ObjectContext.Firmalar.AddObject(firma);
            }
        }

        public void UpdateFirma(Firma currentFirma)
        {
            this.ObjectContext.Firmalar.AttachAsModified(currentFirma, this.ChangeSet.GetOriginal(currentFirma));
        }

        public void DeleteFirma(Firma firma)
        {
            if ((firma.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(firma, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.Firmalar.Attach(firma);
                this.ObjectContext.Firmalar.DeleteObject(firma);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'FirmaListesi' query.
        public IQueryable<FirmaListe> GetFirmaListesi()
        {
            return this.ObjectContext.FirmaListesi;
        }

        public void InsertFirmaListe(FirmaListe firmaListe)
        {
            if ((firmaListe.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(firmaListe, EntityState.Added);
            }
            else
            {
                this.ObjectContext.FirmaListesi.AddObject(firmaListe);
            }
        }

        public void UpdateFirmaListe(FirmaListe currentFirmaListe)
        {
            this.ObjectContext.FirmaListesi.AttachAsModified(currentFirmaListe, this.ChangeSet.GetOriginal(currentFirmaListe));
        }

        public void DeleteFirmaListe(FirmaListe firmaListe)
        {
            if ((firmaListe.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(firmaListe, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.FirmaListesi.Attach(firmaListe);
                this.ObjectContext.FirmaListesi.DeleteObject(firmaListe);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'FirmwareTanimlari' query.
        public IQueryable<FirmwareTanim> GetFirmwareTanimlari()
        {
            return this.ObjectContext.FirmwareTanimlari;
        }

        public void InsertFirmwareTanim(FirmwareTanim firmwareTanim)
        {
            if ((firmwareTanim.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(firmwareTanim, EntityState.Added);
            }
            else
            {
                this.ObjectContext.FirmwareTanimlari.AddObject(firmwareTanim);
            }
        }

        public void UpdateFirmwareTanim(FirmwareTanim currentFirmwareTanim)
        {
            this.ObjectContext.FirmwareTanimlari.AttachAsModified(currentFirmwareTanim, this.ChangeSet.GetOriginal(currentFirmwareTanim));
        }

        public void DeleteFirmwareTanim(FirmwareTanim firmwareTanim)
        {
            if ((firmwareTanim.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(firmwareTanim, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.FirmwareTanimlari.Attach(firmwareTanim);
                this.ObjectContext.FirmwareTanimlari.DeleteObject(firmwareTanim);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'FormTasarimlari' query.
        public IQueryable<FormTasarimi> GetFormTasarimlari()
        {
            return this.ObjectContext.FormTasarimlari;
        }

        public void InsertFormTasarimi(FormTasarimi formTasarimi)
        {
            if ((formTasarimi.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(formTasarimi, EntityState.Added);
            }
            else
            {
                this.ObjectContext.FormTasarimlari.AddObject(formTasarimi);
            }
        }

        public void UpdateFormTasarimi(FormTasarimi currentFormTasarimi)
        {
            this.ObjectContext.FormTasarimlari.AttachAsModified(currentFormTasarimi, this.ChangeSet.GetOriginal(currentFormTasarimi));
        }

        public void DeleteFormTasarimi(FormTasarimi formTasarimi)
        {
            if ((formTasarimi.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(formTasarimi, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.FormTasarimlari.Attach(formTasarimi);
                this.ObjectContext.FormTasarimlari.DeleteObject(formTasarimi);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'GarantiSozlesmeleri' query.
        public IQueryable<GarantiSozlesmesi> GetGarantiSozlesmeleri()
        {
            return this.ObjectContext.GarantiSozlesmeleri;
        }

        public void InsertGarantiSozlesmesi(GarantiSozlesmesi garantiSozlesmesi)
        {
            if ((garantiSozlesmesi.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(garantiSozlesmesi, EntityState.Added);
            }
            else
            {
                this.ObjectContext.GarantiSozlesmeleri.AddObject(garantiSozlesmesi);
            }
        }

        public void UpdateGarantiSozlesmesi(GarantiSozlesmesi currentGarantiSozlesmesi)
        {
            this.ObjectContext.GarantiSozlesmeleri.AttachAsModified(currentGarantiSozlesmesi, this.ChangeSet.GetOriginal(currentGarantiSozlesmesi));
        }

        public void DeleteGarantiSozlesmesi(GarantiSozlesmesi garantiSozlesmesi)
        {
            if ((garantiSozlesmesi.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(garantiSozlesmesi, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.GarantiSozlesmeleri.Attach(garantiSozlesmesi);
                this.ObjectContext.GarantiSozlesmeleri.DeleteObject(garantiSozlesmesi);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'HizmetKartlari' query.
        public IQueryable<HizmetKarti> GetHizmetKartlari()
        {
            return this.ObjectContext.HizmetKartlari;
        }

        public void InsertHizmetKarti(HizmetKarti hizmetKarti)
        {
            if ((hizmetKarti.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(hizmetKarti, EntityState.Added);
            }
            else
            {
                this.ObjectContext.HizmetKartlari.AddObject(hizmetKarti);
            }
        }

        public void UpdateHizmetKarti(HizmetKarti currentHizmetKarti)
        {
            this.ObjectContext.HizmetKartlari.AttachAsModified(currentHizmetKarti, this.ChangeSet.GetOriginal(currentHizmetKarti));
        }

        public void DeleteHizmetKarti(HizmetKarti hizmetKarti)
        {
            if ((hizmetKarti.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(hizmetKarti, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.HizmetKartlari.Attach(hizmetKarti);
                this.ObjectContext.HizmetKartlari.DeleteObject(hizmetKarti);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'HizmetKartListesi' query.
        public IQueryable<HizmetKartListe> GetHizmetKartListesi()
        {
            return this.ObjectContext.HizmetKartListesi;
        }

        public void InsertHizmetKartListe(HizmetKartListe hizmetKartListe)
        {
            if ((hizmetKartListe.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(hizmetKartListe, EntityState.Added);
            }
            else
            {
                this.ObjectContext.HizmetKartListesi.AddObject(hizmetKartListe);
            }
        }

        public void UpdateHizmetKartListe(HizmetKartListe currentHizmetKartListe)
        {
            this.ObjectContext.HizmetKartListesi.AttachAsModified(currentHizmetKartListe, this.ChangeSet.GetOriginal(currentHizmetKartListe));
        }

        public void DeleteHizmetKartListe(HizmetKartListe hizmetKartListe)
        {
            if ((hizmetKartListe.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(hizmetKartListe, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.HizmetKartListesi.Attach(hizmetKartListe);
                this.ObjectContext.HizmetKartListesi.DeleteObject(hizmetKartListe);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'KapamaSebepleri' query.
        public IQueryable<KapamaSebebi> GetKapamaSebepleri()
        {
            return this.ObjectContext.KapamaSebepleri;
        }

        public void InsertKapamaSebebi(KapamaSebebi kapamaSebebi)
        {
            if ((kapamaSebebi.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(kapamaSebebi, EntityState.Added);
            }
            else
            {
                this.ObjectContext.KapamaSebepleri.AddObject(kapamaSebebi);
            }
        }

        public void UpdateKapamaSebebi(KapamaSebebi currentKapamaSebebi)
        {
            this.ObjectContext.KapamaSebepleri.AttachAsModified(currentKapamaSebebi, this.ChangeSet.GetOriginal(currentKapamaSebebi));
        }

        public void DeleteKapamaSebebi(KapamaSebebi kapamaSebebi)
        {
            if ((kapamaSebebi.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(kapamaSebebi, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.KapamaSebepleri.Attach(kapamaSebebi);
                this.ObjectContext.KapamaSebepleri.DeleteObject(kapamaSebebi);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'Kullanicilar' query.
        public IQueryable<Kullanici> GetKullanicilar()
        {
            return this.ObjectContext.Kullanicilar;
        }

        public void InsertKullanici(Kullanici kullanici)
        {
            if ((kullanici.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(kullanici, EntityState.Added);
            }
            else
            {
                this.ObjectContext.Kullanicilar.AddObject(kullanici);
            }
        }

        public void UpdateKullanici(Kullanici currentKullanici)
        {
            this.ObjectContext.Kullanicilar.AttachAsModified(currentKullanici, this.ChangeSet.GetOriginal(currentKullanici));
        }

        public void DeleteKullanici(Kullanici kullanici)
        {
            if ((kullanici.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(kullanici, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.Kullanicilar.Attach(kullanici);
                this.ObjectContext.Kullanicilar.DeleteObject(kullanici);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'MontajListesi' query.
        public IQueryable<MontajListe> GetMontajListesi()
        {
            return this.ObjectContext.MontajListesi;
        }

        public void InsertMontajListe(MontajListe montajListe)
        {
            if ((montajListe.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(montajListe, EntityState.Added);
            }
            else
            {
                this.ObjectContext.MontajListesi.AddObject(montajListe);
            }
        }

        public void UpdateMontajListe(MontajListe currentMontajListe)
        {
            this.ObjectContext.MontajListesi.AttachAsModified(currentMontajListe, this.ChangeSet.GetOriginal(currentMontajListe));
        }

        public void DeleteMontajListe(MontajListe montajListe)
        {
            if ((montajListe.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(montajListe, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.MontajListesi.Attach(montajListe);
                this.ObjectContext.MontajListesi.DeleteObject(montajListe);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'OzellikTanimlari' query.
        public IQueryable<OzellikTanimi> GetOzellikTanimlari()
        {
            return this.ObjectContext.OzellikTanimlari;
        }

        public void InsertOzellikTanimi(OzellikTanimi ozellikTanimi)
        {
            if ((ozellikTanimi.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(ozellikTanimi, EntityState.Added);
            }
            else
            {
                this.ObjectContext.OzellikTanimlari.AddObject(ozellikTanimi);
            }
        }

        public void UpdateOzellikTanimi(OzellikTanimi currentOzellikTanimi)
        {
            this.ObjectContext.OzellikTanimlari.AttachAsModified(currentOzellikTanimi, this.ChangeSet.GetOriginal(currentOzellikTanimi));
        }

        public void DeleteOzellikTanimi(OzellikTanimi ozellikTanimi)
        {
            if ((ozellikTanimi.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(ozellikTanimi, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.OzellikTanimlari.Attach(ozellikTanimi);
                this.ObjectContext.OzellikTanimlari.DeleteObject(ozellikTanimi);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'Parametreler' query.
        public IQueryable<Parametre> GetParametreler()
        {
            return this.ObjectContext.Parametreler;
        }

        public void InsertParametre(Parametre parametre)
        {
            if ((parametre.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(parametre, EntityState.Added);
            }
            else
            {
                this.ObjectContext.Parametreler.AddObject(parametre);
            }
        }

        public void UpdateParametre(Parametre currentParametre)
        {
            this.ObjectContext.Parametreler.AttachAsModified(currentParametre, this.ChangeSet.GetOriginal(currentParametre));
        }

        public void DeleteParametre(Parametre parametre)
        {
            if ((parametre.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(parametre, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.Parametreler.Attach(parametre);
                this.ObjectContext.Parametreler.DeleteObject(parametre);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'ParcaTanimlari' query.
        public IQueryable<ParcaTanim> GetParcaTanimlari()
        {
            return this.ObjectContext.ParcaTanimlari;
        }

        public void InsertParcaTanim(ParcaTanim parcaTanim)
        {
            if ((parcaTanim.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(parcaTanim, EntityState.Added);
            }
            else
            {
                this.ObjectContext.ParcaTanimlari.AddObject(parcaTanim);
            }
        }

        public void UpdateParcaTanim(ParcaTanim currentParcaTanim)
        {
            this.ObjectContext.ParcaTanimlari.AttachAsModified(currentParcaTanim, this.ChangeSet.GetOriginal(currentParcaTanim));
        }

        public void DeleteParcaTanim(ParcaTanim parcaTanim)
        {
            if ((parcaTanim.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(parcaTanim, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.ParcaTanimlari.Attach(parcaTanim);
                this.ObjectContext.ParcaTanimlari.DeleteObject(parcaTanim);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'Raporlar' query.
        public IQueryable<Rapor> GetRaporlar()
        {
            return this.ObjectContext.Raporlar;
        }

        public void InsertRapor(Rapor rapor)
        {
            if ((rapor.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(rapor, EntityState.Added);
            }
            else
            {
                this.ObjectContext.Raporlar.AddObject(rapor);
            }
        }

        public void UpdateRapor(Rapor currentRapor)
        {
            this.ObjectContext.Raporlar.AttachAsModified(currentRapor, this.ChangeSet.GetOriginal(currentRapor));
        }

        public void DeleteRapor(Rapor rapor)
        {
            if ((rapor.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(rapor, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.Raporlar.Attach(rapor);
                this.ObjectContext.Raporlar.DeleteObject(rapor);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'ServisKontrolleri' query.
        public IQueryable<ServisKontrol> GetServisKontrolleri()
        {
            return this.ObjectContext.ServisKontrolleri;
        }

        public void InsertServisKontrol(ServisKontrol servisKontrol)
        {
            if ((servisKontrol.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(servisKontrol, EntityState.Added);
            }
            else
            {
                this.ObjectContext.ServisKontrolleri.AddObject(servisKontrol);
            }
        }

        public void UpdateServisKontrol(ServisKontrol currentServisKontrol)
        {
            this.ObjectContext.ServisKontrolleri.AttachAsModified(currentServisKontrol, this.ChangeSet.GetOriginal(currentServisKontrol));
        }

        public void DeleteServisKontrol(ServisKontrol servisKontrol)
        {
            if ((servisKontrol.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(servisKontrol, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.ServisKontrolleri.Attach(servisKontrol);
                this.ObjectContext.ServisKontrolleri.DeleteObject(servisKontrol);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'ServisKontrolTanimlari' query.
        public IQueryable<ServisKontrolTanimi> GetServisKontrolTanimlari()
        {
            return this.ObjectContext.ServisKontrolTanimlari;
        }

        public void InsertServisKontrolTanimi(ServisKontrolTanimi servisKontrolTanimi)
        {
            if ((servisKontrolTanimi.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(servisKontrolTanimi, EntityState.Added);
            }
            else
            {
                this.ObjectContext.ServisKontrolTanimlari.AddObject(servisKontrolTanimi);
            }
        }

        public void UpdateServisKontrolTanimi(ServisKontrolTanimi currentServisKontrolTanimi)
        {
            this.ObjectContext.ServisKontrolTanimlari.AttachAsModified(currentServisKontrolTanimi, this.ChangeSet.GetOriginal(currentServisKontrolTanimi));
        }

        public void DeleteServisKontrolTanimi(ServisKontrolTanimi servisKontrolTanimi)
        {
            if ((servisKontrolTanimi.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(servisKontrolTanimi, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.ServisKontrolTanimlari.Attach(servisKontrolTanimi);
                this.ObjectContext.ServisKontrolTanimlari.DeleteObject(servisKontrolTanimi);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'ServisListesi' query.
        public IQueryable<ServisListe> GetServisListesi()
        {
            return this.ObjectContext.ServisListesi;
        }

        public void InsertServisListe(ServisListe servisListe)
        {
            if ((servisListe.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(servisListe, EntityState.Added);
            }
            else
            {
                this.ObjectContext.ServisListesi.AddObject(servisListe);
            }
        }

        public void UpdateServisListe(ServisListe currentServisListe)
        {
            this.ObjectContext.ServisListesi.AttachAsModified(currentServisListe, this.ChangeSet.GetOriginal(currentServisListe));
        }

        public void DeleteServisListe(ServisListe servisListe)
        {
            if ((servisListe.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(servisListe, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.ServisListesi.Attach(servisListe);
                this.ObjectContext.ServisListesi.DeleteObject(servisListe);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'ServisMerkezleri' query.
        public IQueryable<ServisMerkezi> GetServisMerkezleri()
        {
            return this.ObjectContext.ServisMerkezleri;
        }

        public void InsertServisMerkezi(ServisMerkezi servisMerkezi)
        {
            if ((servisMerkezi.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(servisMerkezi, EntityState.Added);
            }
            else
            {
                this.ObjectContext.ServisMerkezleri.AddObject(servisMerkezi);
            }
        }

        public void UpdateServisMerkezi(ServisMerkezi currentServisMerkezi)
        {
            this.ObjectContext.ServisMerkezleri.AttachAsModified(currentServisMerkezi, this.ChangeSet.GetOriginal(currentServisMerkezi));
        }

        public void DeleteServisMerkezi(ServisMerkezi servisMerkezi)
        {
            if ((servisMerkezi.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(servisMerkezi, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.ServisMerkezleri.Attach(servisMerkezi);
                this.ObjectContext.ServisMerkezleri.DeleteObject(servisMerkezi);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'ServisSorunTanimlari' query.
        public IQueryable<ServisSorunTanimi> GetServisSorunTanimlari()
        {
            return this.ObjectContext.ServisSorunTanimlari;
        }

        public void InsertServisSorunTanimi(ServisSorunTanimi servisSorunTanimi)
        {
            if ((servisSorunTanimi.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(servisSorunTanimi, EntityState.Added);
            }
            else
            {
                this.ObjectContext.ServisSorunTanimlari.AddObject(servisSorunTanimi);
            }
        }

        public void UpdateServisSorunTanimi(ServisSorunTanimi currentServisSorunTanimi)
        {
            this.ObjectContext.ServisSorunTanimlari.AttachAsModified(currentServisSorunTanimi, this.ChangeSet.GetOriginal(currentServisSorunTanimi));
        }

        public void DeleteServisSorunTanimi(ServisSorunTanimi servisSorunTanimi)
        {
            if ((servisSorunTanimi.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(servisSorunTanimi, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.ServisSorunTanimlari.Attach(servisSorunTanimi);
                this.ObjectContext.ServisSorunTanimlari.DeleteObject(servisSorunTanimi);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'ServisSorunlari' query.
        public IQueryable<ServisSorunu> GetServisSorunlari()
        {
            return this.ObjectContext.ServisSorunlari;
        }

        public void InsertServisSorunu(ServisSorunu servisSorunu)
        {
            if ((servisSorunu.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(servisSorunu, EntityState.Added);
            }
            else
            {
                this.ObjectContext.ServisSorunlari.AddObject(servisSorunu);
            }
        }

        public void UpdateServisSorunu(ServisSorunu currentServisSorunu)
        {
            this.ObjectContext.ServisSorunlari.AttachAsModified(currentServisSorunu, this.ChangeSet.GetOriginal(currentServisSorunu));
        }

        public void DeleteServisSorunu(ServisSorunu servisSorunu)
        {
            if ((servisSorunu.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(servisSorunu, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.ServisSorunlari.Attach(servisSorunu);
                this.ObjectContext.ServisSorunlari.DeleteObject(servisSorunu);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'SistemTanimlari' query.
        public IQueryable<SistemTanim> GetSistemTanimlari()
        {
            return this.ObjectContext.SistemTanimlari;
        }

        public void InsertSistemTanim(SistemTanim sistemTanim)
        {
            if ((sistemTanim.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(sistemTanim, EntityState.Added);
            }
            else
            {
                this.ObjectContext.SistemTanimlari.AddObject(sistemTanim);
            }
        }

        public void UpdateSistemTanim(SistemTanim currentSistemTanim)
        {
            this.ObjectContext.SistemTanimlari.AttachAsModified(currentSistemTanim, this.ChangeSet.GetOriginal(currentSistemTanim));
        }

        public void DeleteSistemTanim(SistemTanim sistemTanim)
        {
            if ((sistemTanim.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(sistemTanim, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.SistemTanimlari.Attach(sistemTanim);
                this.ObjectContext.SistemTanimlari.DeleteObject(sistemTanim);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'StokBilgileri' query.
        public IQueryable<StokBilgi> GetStokBilgileri()
        {
            return this.ObjectContext.StokBilgileri;
        }

        public void InsertStokBilgi(StokBilgi stokBilgi)
        {
            if ((stokBilgi.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(stokBilgi, EntityState.Added);
            }
            else
            {
                this.ObjectContext.StokBilgileri.AddObject(stokBilgi);
            }
        }

        public void UpdateStokBilgi(StokBilgi currentStokBilgi)
        {
            this.ObjectContext.StokBilgileri.AttachAsModified(currentStokBilgi, this.ChangeSet.GetOriginal(currentStokBilgi));
        }

        public void DeleteStokBilgi(StokBilgi stokBilgi)
        {
            if ((stokBilgi.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(stokBilgi, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.StokBilgileri.Attach(stokBilgi);
                this.ObjectContext.StokBilgileri.DeleteObject(stokBilgi);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'Teknisyenler' query.
        public IQueryable<Teknisyen> GetTeknisyenler()
        {
            return this.ObjectContext.Teknisyenler;
        }

        public void InsertTeknisyen(Teknisyen teknisyen)
        {
            if ((teknisyen.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(teknisyen, EntityState.Added);
            }
            else
            {
                this.ObjectContext.Teknisyenler.AddObject(teknisyen);
            }
        }

        public void UpdateTeknisyen(Teknisyen currentTeknisyen)
        {
            this.ObjectContext.Teknisyenler.AttachAsModified(currentTeknisyen, this.ChangeSet.GetOriginal(currentTeknisyen));
        }

        public void DeleteTeknisyen(Teknisyen teknisyen)
        {
            if ((teknisyen.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(teknisyen, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.Teknisyenler.Attach(teknisyen);
                this.ObjectContext.Teknisyenler.DeleteObject(teknisyen);
            }
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'YeniMontajListesi' query.
        public IQueryable<YeniMontaj> GetYeniMontajListesi()
        {
            return this.ObjectContext.YeniMontajListesi;
        }

        public void InsertYeniMontaj(YeniMontaj yeniMontaj)
        {
            if ((yeniMontaj.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(yeniMontaj, EntityState.Added);
            }
            else
            {
                this.ObjectContext.YeniMontajListesi.AddObject(yeniMontaj);
            }
        }

        public void UpdateYeniMontaj(YeniMontaj currentYeniMontaj)
        {
            this.ObjectContext.YeniMontajListesi.AttachAsModified(currentYeniMontaj, this.ChangeSet.GetOriginal(currentYeniMontaj));
        }

        public void DeleteYeniMontaj(YeniMontaj yeniMontaj)
        {
            if ((yeniMontaj.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(yeniMontaj, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.YeniMontajListesi.Attach(yeniMontaj);
                this.ObjectContext.YeniMontajListesi.DeleteObject(yeniMontaj);
            }
        }
    }
}


